struct ListNode* removeNthFromEnd(struct ListNode* head, int n){
    int a=0,i;
    struct ListNode*node=head;
    struct ListNode*ret=head;
    while(node)
    {
        a++;
        node=node->next;
    }
    if(n==a)
    {
        ret=ret->next;
        return ret;
    }
    for(i=0;i<a-n-1;i++)
    {
        ret=ret->next;
    }
    ret->next=ret->next->next;
    return head;

        
}